package com.boe.config.mybatisplus;

import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.boe.common.util.RandomUtil;

public class BoeIdGenerator implements IdentifierGenerator {
    @Override
    public Number nextId(Object entity) {
        return null;
    }

    @Override
    public String nextUUID(Object entity) {
        return Long.toString(IdUtil.getSnowflake(RandomUtil.getRandomNumber(1, 31), RandomUtil.getRandomNumber(1, 31)).nextId(), 36);
    }
}
